import {baseUrl} from './config.js'
//首页的接口
export function topList() {
	
	return new Promise(function(reslove,reject) {
		uni.request({
		url:`${baseUrl}/toplist/detail`,
		method:'GET',
		success:res => {
			let result = res.data.list
			result.length=4
			reslove(result)
		}
	})
	})
	
}

//歌单详情页接口
export function list(id) {
	return uni.request({
		url:`${baseUrl}/playlist/detail?id=${id}`,
		method:'GET'
		
	})
}

//歌曲详情页接口
export function songDetail(songId) {
	return uni.request({
		url:`${baseUrl}/song/detail?ids=${songId}`,
		method:'GET'
		
	})
}

//相似歌曲接口
export function songSimi(songId) {
	return uni.request({
		url:`${baseUrl}/simi/song?id=${songId}`,
		method:'GET'
		
	})
}

//歌曲的评论接口
export function songComment(songId) {
	return uni.request({
		url:`${baseUrl}/comment/music?id=${songId}`,
		method:'GET'
		
	})
}

//歌曲歌词接口
export function songLyric(songId) {
	return uni.request({
		url:`${baseUrl}/lyric?id=${songId}`,
		method:'GET'
		
	})
}


//歌曲播放接口
export function songUrl(songId) {
	return uni.request({
		url:`${baseUrl}/song/url?id=${songId}`,
		method:'GET'
		
	})
}

//搜索热门接口
export function searchHot()  {
	return uni.request({
		url:`${baseUrl}/search/hot/detail`,
		method:'GET'
	})
}

//搜索结果接口
export function searchWord(word)  {
	return uni.request({
		url:`${baseUrl}/search?keywords=${word}`,
		method:'GET'
	})
}

//搜索下拉提示接口
export function searchSuggest(word)  {
	return uni.request({
		url:`${baseUrl}/search/suggest?keywords=${word}&type=mobile`,
		method:'GET'
	})
}

